http = new XMLHttpRequest();

function messageHandler(e) { 
    
} 
 
addEventListener("message", messageHandler, true); 

function get()
	{	
	http.open("GET","msgget.php", true);
	http.onreadystatechange = HttpResponse;
	http.send();
	}
function HttpResponse()
	{
	if (http.readyState == 4) 
		{
		var textout = http.responseText;
		postMessage(textout);
		}
	setTimeout("get()",1000);
	}
get();